package com.genwangsun.nettydemo;

import com.genwangsun.nettydemo.config.redisInfra.RedisMessageListener;
import com.genwangsun.nettydemo.websocket.NettyServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class NettyDemoApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(NettyDemoApplication.class, args);
        RedisMessageListener redisMessageListener = applicationContext.getBean(RedisMessageListener.class);
        NettyServer nettyServer = applicationContext.getBean(NettyServer.class);

        redisMessageListener.subscribe();
        nettyServer.run();
    }

}
